package com.woniuxy.lifeorder.api.feign.fallback;

import com.woniuxy.life.core.api.CommonResult;
import com.woniuxy.lifeorder.api.dto.Orderitem;
import com.woniuxy.lifeorder.api.feign.OrderItemService;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
@Setter
public class OrderItemServiceFallbackImpl implements OrderItemService {
    private Throwable cause;

    @Override
    public CommonResult<List<Orderitem>> listCommonResult(Orderitem orderitem) {
        log.error("订单项查询错误",cause);
        return CommonResult.failed(500L,"订单项查询错误");
    }

    @Override
    public CommonResult insertOne(Orderitem orderitem) {
        log.error("订单项插入错误1",cause);
        return CommonResult.failed(500L,"订单项插入错误1");
    }

    @Override
    public CommonResult insertAll(List<Orderitem> orderitems) {
        log.error("订单项插入错误2",cause);
        return CommonResult.failed(500L,"订单项插入错误2");
    }

    @Override
    public CommonResult deleteOne(Integer orderitemId) {
        log.error("订单项删除错误",cause);
        return CommonResult.failed(500L,"订单项删除错误");
    }
}
